From: mjw@wray-m-3.hpl.hp.com Date: Thu, 24 Jun 2004 18:55:01 +0000 (+0000) Subject: bitkeeper revision 1.1010.1.3 (40db2385Aq2phajZDogkMkJtQna8qA) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18098^2~7 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=e2d0742d49216ec924d91a8c8bd9a4faaeefcfb6;p=xen.git bitkeeper revision 1.1010.1.3 (40db2385Aq2phajZDogkMkJtQna8qA) Some small help fixes. --- diff --git a/tools/xenmgr/lib/xm/main.py b/tools/xenmgr/lib/xm/main.py index 86f606fd83..09b658d850 100644 --- a/tools/xenmgr/lib/xm/main.py +++ b/tools/xenmgr/lib/xm/main.py @@ -127,7 +127,7 @@ class ProgHelp(Prog): name = args[1] p = self.xm.getprog(name) if p: - p.help(args) + p.help(args[1:]) else: print '%s: Unknown command: %s' % (self.name, name) else: @@ -159,22 +159,13 @@ class ProgSave(Prog): info = """Save domain state (and config) to file.""" def help(self, args): - print args[0], "DOM FILE [CONFIG]" - print """\nSave domain with id DOM to FILE. - Optionally save config to CONFIG.""" + print args[0], "DOM FILE" + print """\nSave domain with id DOM to FILE.""" def main(self, args): if len(args) < 3: self.err("%s: Missing arguments" % args[0]) dom = args[1] savefile = os.path.abspath(args[2]) - configfile = None - if len(args) == 4: - configfile = os.path.abspath(args[3]) - if configfile: - out = file(configfile, 'w') - config = server.xend_domain(dom) - PrettyPrint.prettyprint(config, out=out) - out.close() server.xend_domain_save(dom, savefile) xm.prog(ProgSave) @@ -185,13 +176,16 @@ class ProgRestore(Prog): info = """Create a domain from a saved state.""" def help(self, args): - print args[0], "FILE CONFIG" + print args[0], "FILE [CONFIG]" print "\nRestore a domain from FILE using configuration CONFIG." def main(self, help, args): - if len(args) < 3: self.err("%s: Missing arguments" % args[0]) + if len(args) < 2: self.err("%s: Missing arguments" % args[0]) savefile = os.path.abspath(args[1]) - configfile = os.path.abspath(args[2]) + if len(args) >= 3: + configfile = os.path.abspath(args[2]) + else: + configfile = None info = server.xend_domain_restore(savefile, configfile) PrettyPrint.prettyprint(info) diff --git a/tools/xenmgr/lib/xm/shutdown.py b/tools/xenmgr/lib/xm/shutdown.py index 7cdcc63105..50d98bec5e 100644 --- a/tools/xenmgr/lib/xm/shutdown.py +++ b/tools/xenmgr/lib/xm/shutdown.py @@ -64,7 +64,7 @@ def main_dom(opts, args): def main(argv): opts = gopts args = opts.parse(argv) - if opts.help: + if opts.vals.help: opts.usage() return print 'shutdown.main>', len(args), args